#include <boost/serialization/map.hpp>
#include <boost/serialization/string.hpp>
#include <boost/archive/binary_iarchive.hpp>

#include <fstream>
#include <map>

using namespace std;

typedef map<string, int> string_int_map;
map<string, string_int_map > m;

int main(){
  ifstream ifs("out.bin",ios::binary);
  boost::archive::binary_iarchive oa(ifs);
  oa >> BOOST_SERIALIZATION_NVP(m);

  for(map<string, string_int_map >::iterator i = m.begin();i != m.end(); i++){
    cout << endl << i->first;
    string_int_map & mm = i->second;
    for(string_int_map::iterator ii = mm.begin(); ii != mm.end(); ii++){
      cout << endl << ii->first << " " << ii->second;
    }
    }
    
  return 0;
}
